package com.guchenbo.schedule.config;

import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.springframework.aop.support.NameMatchMethodPointcutAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author guchenbo
 * @date 2021/4/11
 */
@EnableScheduling
@EnableSchedulerLock(defaultLockAtMostFor = "PT15S")
@Configuration
public class ScheduleConfig {

  @Bean
  public NameMatchMethodPointcutAdvisor nameMatchMethodPointcutAdvisor(){
    NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor();
    return advisor;
  }
}
